import Dep from './dep'
import Watcher from './watcher'

export function effectWatch(expressFn, fn) {
  Dep.target = new Watcher(fn)
  const res = expressFn.bind(this).call()
  Dep.target = null
  return res
}

export function effect(fn) {
  return effectWatch(fn, fn)
}
